package com.kexilo;

import org.springframework.boot.Banner;
import org.springframework.core.env.Environment;

import java.io.PrintStream;

/**
 * Kexilo自定义启动Banner
 * 
 * @author Kexilo
 */
public class KexiloBanner implements Banner {

    private static final String BANNER = 
        "\n" +
        "  _  __          _ _       \n" +
        " | |/ /         (_) |      \n" +
        " | ' / _____  ___| | ___   \n" +
        " |  < / _ \\ \\/ / | |/ _ \\  \n" +
        " | . \\  __/>  <| | | (_) | \n" +
        " |_|\\_\\___/_/\\_\\_|_|\\___/  \n" +
        "                           \n" +
        " :: Kexilo权限管理系统 ::   \n" +
        "                           \n";

    @Override
    public void printBanner(Environment environment, Class<?> sourceClass, PrintStream out) {
        out.println(BANNER);
        out.println(" :: Spring Boot :: (v3.2.0)");
        out.println(" :: Kexilo Version :: (v1.0.0)");
        out.println(" :: Profile :: (" + String.join(",", environment.getActiveProfiles()) + ")");
        out.println();
    }
}
